The Web Reports Server provides not only a powerful means of distributing reports across the web, but also provides a report distribution mechanism that can be incorporated into multi
Connecting to the Web Reports Server requires accessing two new ActiveX components: the WebReportBroker and the WebReportSource. The following samples demonstrate how to connect to the Web Reports Server using Connecting from Visual Basic, and Connecting from VBScript, inside a web page.
The following code is an example of how to connect to the Web Reports Server from Visual Basic and assign a report to the Crystal Report Viewer for ActiveX. This assumes that you have added the ActiveX viewer control to a form named Form1, and the ActiveX viewer control is named CRViewer1.
Private Sub Form1_Load() Dim webBroker, webSource
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
Set webSource = CreateObject("WebreportSource.WebReportSource") webSource.ReportSource = webBroker
webSource.URL = "http://<machinename>/scrreports/xtreme/hr.rpt"
webSource.Title = "Employee Profiles" CRViewer1.ReportSource = webSource
CRViewer1.ViewReport End Sub
The following code assumes you have added the Crystal Report Viewer for ActiveX to a web page using the <OBJECT> tag and assigned it an ID of CRViewer.
<OBJECT ID="WebSource" Width=0 Height=0>
CLASSID="CLSID:F2CA2115-C 8D2-1 1D1-B EBD-0 0A0C95A6A5C"
CODEBASE="viewer/ActiveXViewer/swebrs.dll#Version=1.2.0.5"
</OBJECT> <OBJECT ID="WebBroker" Width=0 Height=0>
CLASSID="CLSID:F2CA2119-C 8D2-1 1D1-B EBD-0 0A0C95A6A5C"
CODEBASE="viewer/ActiveXViewer/swebrs.dll#Version=1.2.0.5"
</OBJECT> <OBJECT ID="Export" Width=0 Height=0>
CLASSID="CLSID:BD10A9C1-0 7CC-1 1D2-B EFF-0 0A0C95A6A5C"
CODEBASE="viewer/ActiveXViewer/sviewhlp.dll#Version=1.0.0.4"
</OBJECT> <SCRIPT LANGUAGE="VBScript">
<!--
Sub Page_Initialize
Dim webBroker
Dim webSource
Set webBroker = CreateObject("WebReportBroker.WebReportBroker")
Set webSource = CreateObject("WebReportSource.WebReportSource")
webSource.ReportSource = webBroker
webSource.URL = Location.Protocol + "//" + Location.Host + _
"/scrreports/xtreme/invent.rpt"
CRViewer.ReportSource = webSource
CRViewer.ViewReport
End Sub
-->
</SCRIPT>
Seagate Software IMG Holdings, Inc. http://www.seagatesoftware.com Support services: http://support.seagatesoftware.com |